welo git mirrors
Commit faf7f8a8d3b296f1507699b21a8d7000dcdc57ef
Parents : a10fd2f
Author : welo | main nixos computer <empty@empty.com>
Date : 2026-07-03T21:26:02+01:00
idk whay I've changed at this point
Changes
Diff
diff --git a/src/client.rs b/src/client.rs
index 8a28d70..d41b319 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -365,13 +365,16 @@ async fn handle_udp_connect(
.await;
// Reply to SOCKS5 client based on RNS connection result
- let dummy_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 0);
- let port = dummy_addr.port();
+
+ let udp_stream = UdpSocket::bind(format!("0.0.0.0:0")).await.expect("unable to get udp socket");
+ let port = udp_stream.local_addr().unwrap().port();
+ let relay_address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port);
+
let stream = match connect_result {
Ok(Ok(())) => {
// Connection succeeded -- send SOCKS5 success reply
- match proto.reply_success(dummy_addr).await {
+ match proto.reply_success(relay_address).await {
Ok(s) => s,
Err(e) => {
debug!("[{}] Failed to send SOCKS5 reply: {:?}", sid, e);
@@ -396,7 +399,6 @@ async fn handle_udp_connect(
};
- let udp_stream = UdpSocket::bind("0.0.0.0:0").await.expect("unable to get udp socket");
diff --git a/src/relay.rs b/src/relay.rs
index 00fc0f6..c774fb5 100644
--- a/src/relay.rs
+++ b/src/relay.rs
@@ -149,8 +149,7 @@ pub async fn relay_bidirectional_udp(
}
None => {
tokio::spawn(async move {
-
- tokio::time::sleep(Duration::from_hours(100000000000)); // lmao // I can't be bothered importing the empty future thing.
+ tokio::time::sleep(Duration::from_hours(100000000000)).await; // lmao // I can't be bothered importing the empty future thing.
})
}
};
Served by rngit 1.5.1 - Generated in 0.02s